package com.ruoyi.user.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.user.mapper.BalanceLogMapper;
import com.ruoyi.user.model.pojo.entity.BalanceLog;
import com.ruoyi.user.service.IBalanceLogService;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 资产记录 服务实现类
 * </p>
 *
 * @author Gnc
 * @since 2024-12-24
 */
@Service
public class BalanceLogServiceImpl extends ServiceImpl<BalanceLogMapper, BalanceLog> implements IBalanceLogService {

    @Override
    public void addLog(Long userId, Integer type, String content, Integer balanceType, Long unqiId, BigDecimal money) {
        BalanceLog balanceLog = new BalanceLog();
        balanceLog.setUserId(userId);
        balanceLog.setType(type);
        balanceLog.setBalanceLogType(balanceType);
        balanceLog.setCreateTime(new Date());
        balanceLog.setContent(content);
        balanceLog.setRemark(content);
        balanceLog.setMoney(money);
        save(balanceLog);
    }
}
